<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <!-- <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> -->
    <meta name="format-detection" content="telephone=no">
    <meta name="referrer" content="no-referrer" />
    <title>{$active.name}-{$record.nickname}</title>
    {include file='default/public/header'/}
</head>
<body style="background: #f5f5f5;">
<style>
.hb_show { width: 400px; text-align: center; margin:0 auto;}
.hb_show img{display: none;  width: 100%; }
.hongbao{text-align: center; position: fixed; width: 100%; margin:0 auto; top: 100px; z-index: 99;}
.hongbao .amount{ display: none; position:absolute; color:#ffffff; font-size: 32px; left:190px; top: 225px;}
    body { margin:0px;padding:0px;text-align: center;}
    #hidebg { position:absolute;left:0px;top:0px;
        background-color:#000;
        width:100%;  /*宽度设置为100%，这样才能使隐藏背景层覆盖原页面*/
        filter:alpha(opacity=60);  /*设置透明度为60%*/
        opacity:0.3;  /*非IE浏览器下设置透明度为60%*/
        display:none; /* https://www.jb51.net */
        z-Index:2;}
</style>
<p id="hidebg"></p>
<div class="page-group">
    <div class="page">
        <div class="content">
            <nav class="bar bar-tab" style="height:0;top: 0;">
                {include file='default/public/fixed'/}
            </nav>
            {include file='default/public/nav'/}
<style>
    body { margin:0px;padding:0px;text-align: center;}
    #hidebg { position:absolute;left:0px;top:0px;
        background-color:#000;
        width:100%;  /*宽度设置为100%，这样才能使隐藏背景层覆盖原页面*/
        filter:alpha(opacity=60);  /*设置透明度为60%*/
        opacity:0.3;  /*非IE浏览器下设置透明度为60%*/
        display:none; /* https://www.jb51.net */
        z-Index:2;}
    .xuanyan-box {
        text-align: left;
    }
</style>
            <div class="detail-info-box">
                <div class="nickname-support-box">
                    <div><span class="playedid">{$record.contestant_number}</span>号</div>
                    <div>{$record.nickname}</div>
                    <div>鲜花:<span class="support-box">{$record.support}</span>朵</div>
                </div>
                <div class="no-box">
                    <div>排名:<span>{$no}</span></div>
                    <div><span class="look_other_2">查看排名</span></div>
                </div>
                <div class="xuanyan-box">
                    <div>战队名称: {$record.nickname}</div>
                </div>
                <div class="xuanyan-box">
                    <div>战队口号:{$record.xuanyan}</div>
                    <!-- <div>{$record.xuanyan}</div> -->
                </div>
<!--            <div class="xuanyan-box">
                    <div>企业名称: {$record.shop_name}</div>
                </div> -->
                <div class="xuanyan-box">
                    <div>战队地址:{$record.shop_address}</div>
                    <!-- <div>{$record.shop_address}</div> -->
                </div>
                <div class="xuanyan-box">
                    <div>战队简介:{$record.shop_introduction}</div>
                    <!-- <div>{$record.shop_introduction}</div> -->
                </div>

            </div>
            <hr class="my-hr"/>      
            <div style="min-height: 300px;">
                <div class="swiper-container-2" data-space-between='10' data-loop="1" style="width:100%;overflow: hidden;margin-top: 10px; padding-bottom:0;position: relative;">
                    <div class="swiper-wrapper ">
                        {foreach name="$record.images" id="vo"}
                        <div class="swiper-slide swiper-slide-1" >
                            {if condition="$record.sign_pass_way == 'yqsbz'"}
                                <img src="{$vo}&where=500&height=400" alt="" style="transform: scale(0.9,0.9);width:100%;">
                            {else}
                                <img src="{$vo}" alt="" style="transform: scale(0.9,0.9);width:100%;">
                            {/if}
                        </div>
                        {/foreach}
                    </div>
                    <div class="swiper-pagination-2" style="position: absolute;bottom:0;width:100%;text-align: center"></div>
                </div>
            </div>
            {if condition="!$is_self"}
            <div class="form-box">
                <div class="item">
                    <div class="form-btn vote_btn" style="background: #e7ae9e;">送 {$number} 朵</div>
                </div>
                {if condition="!empty($active.is_sign_up)"}
                <div class="item">
                    <div class="form-btn sign_btn" style="background: #e7a56d;">我 也 要 参 加</div>
                </div>
                {/if}
                <div class="item">
                    <div class="form-btn look_other" style="background: #e7a56d;">返 回 列 表</div>
                </div>
            </div>
            {else/}
            <div class="form-box">
   <!--              foreach $rewards as $reward
                <div class="item">奖品名 : $reward.name , 领取条件 : $reward.reward_filter , 剩余数量 : $reward.current_number</div>
                /foreach -->
            </div>
            {/if}
            {if condition="$active.business_images"}
            <div style="width: 90%;margin: auto;">
                {foreach $active.business_images as $item}
                <a href="{$item.url}" class="external"><img src="{$item.image}" alt="" style="width: 100%;margin-bottom: 0.3rem;"></a>
                {/foreach}
            </div>
            {/if}
        </div>
    </div>
</div>

<div class="hongbao">
    <div class="hb_show">
        <img class="hbimg" id="hongbao1" src="__PUBLIC__/index/images/hongbao1.png" >
        <img class="hbimg" id="hongbao2" src="__PUBLIC__/index/images/hongbao2.png" >
        <span class="amount"></span>
    </div>
</div>

{include file='default/public/js'/}
<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/swiper.min.js"></script>
<script type="text/javascript">
    $(".swiper-container-2").swiper({
        pagination: '.swiper-pagination-2'
    });
    $('.look_other_2').click(function(){
        location.href = '{:url("index",["id"=>$active["id"],"order"=>2])}';
    });
</script>

<script>
    function show()  //显示隐藏层和弹出层
    {
        var hideobj=document.getElementById("hidebg");
        hidebg.style.display="block";  //显示隐藏层
        hidebg.style.height=document.body.clientHeight+"px";  //设置隐藏层的高度为当前页面高度
    }
    function hide()  //去除隐藏层和弹出层
    {
        document.getElementById("hidebg").style.display="none";
    }

</script>




{if condition="!$is_self"}
<script type="text/javascript">

    $('#hongbao1').click(function(){
        $(this).css("display","none");
        $("#hongbao2").css("display","block");
        $(".amount").css("display","inline");
    });

    $('#hongbao2').click(function(){
        $("#hongbao2").css("display","none");
        $(".amount").css("display","none");
        hide();
    });

    $('.look_other').click(function(){
        location.href = '{:url("index",["id"=>$active["id"],"order"=>2])}';
    });


    $('.sign_btn').click(function(){
        location.href = '{:url("signup",["id"=>$active["id"]])}';
    });

    $('.vote_btn').click(function(){
        $('.vote_btn').attr('disabled','disabled');
        $.post(
            '{:url("do_vote",["id"=>$active["id"]])}','id={$id}&participant_id={$record.user_id}',
            function(data){
                if(data.code == 0){
                    if(data.frequency < data.reward_limit && data.reward_limit > 0){
                        show();
                        $("#hongbao1").css("display","block");
                        $(".amount").text(data.amount);
                    }else{
                        $.toast(data.message);
                    }
                    $('.vote_btn').attr('disabled',null);
                    var support_box = $('.support-box');
                    support_box.text(parseInt(support_box.text())+parseInt(data.support));
                    $('.iframe-box').show();
                }else if(data.code == 504){
                    mag.toLogin(function(rs){
                        window.location.href = '{:url("index",["id"=>$active.id])}?token='+rs.token;
                    });
                }else{
                    $.toast(data.message, "cancel");
                }
            },
            'json'
        )
    });

    $(document).on('click','.reward_btn',function(){
        var mobile = $('input[name=mobile]').val();
        if(mobile == ''){
            $.toast('联系方式不能为空哦~');
            return false;
        }
        var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
        if(!myreg.test(mobile))
        {
            $.toast('请输入有效的手机号码！');
            return false;
        }
        $.post('{:url("reward/chou_ajax")}',{'active_id':'{$active.id}','user_id':'{$se.user_id}','nickname':'{$se.name}','mobile':mobile},
            function(data){
                $.toast(data.message);
                if(data.code==0){
                    $('.iframe-box').hide();
                }
            },'json');
        return false;
    });

    $(document).on('click','.close',function(){
        $('.iframe-box').hide();
    });
</script>
{/if}
<script src='http://app.lxh.magcloud.cc/public/static/dest/js/libs/magjs-x.js'></script>
<script type="text/javascript">
    var share_url = '{$active.share_info.url}';
    {if condition="$record.status == 1"}
    share_url = 'http://touwgf.5iyq0022.com/index.php/index/wx/detail/id/{$id}/user_id/{$record.user_id}';
    {/if}

    mag.setData({
        shareData: {
            title: '{$record.nickname}{$active.share_info.title}',
            des: '{$active.share_info.intro}',
            picurl: '{$active.share_info.img}',
            linkurl: share_url
        }
    });
    
    // mag.setData({
    //   shareData: {
    //       type: 1,
    //       imageurl: 'http://touwgf.5iyq0022.com/upload/cover/2018/02/5a9107bbc59c93527395b19f.png', 
    //       picurl:  'http://touwgf.5iyq0022.com/upload/cover/2018/02/5a9107bbc59c93527395b19f.png'   //4.0.9起不需要再设置picurl
    //     }
    // });

    //生成海报追加
    $(function () {
        var fixed = $('#fixeds');
        fixed.append("<div class='item poster'><img src='__PUBLIC__/index/images/xxxcxl/poster.png' style='width: 100%;float: left';><div class='clear'></div></div>");
        $('.poster').click(function(){
        location.href='{:url("index/poster",["id"=>$active.id,"playerid"=>$record.contestant_number])}';
    });
    })
</script>
</body>
</html>